import React from 'react';
import {connect} from 'dva';;
import {Tabtitle} from '../../../components';
import moment from 'moment';
import {Card, Row, Col,Input} from 'antd';

const Search = Input.Search;

class BenchmarSearch extends React.Component {
	state = {
    value: this.props.name,
  }
  componentWillMount() {
  	console.log(99900,this.props)
  }
	onSearch=(value)=>{
		this.props.dispatch({
			type:'benchmarkMgt/setSatate',
			payload:{
				'name':value
			}
		})
		this.props.dispatch({
			type:'benchmarkMgt/changeRouter',
			payload:{
				'name':value
			}
		})
		this.props.dispatch({
			type:'benchmarkMgt/getBenchmark',
			payload:{
				'name':value,
				'pagesize':15,
				'currentpage':1,
			}
		})
	}


	render(){
		return(
			<Search
	      placeholder="请输入"
	      onSearch={value => this.onSearch(value)}
	      style={{ width: 200 }}
	    />
		)
	}
}
BenchmarSearch.defaultProps={
	value:'',
	location: {
    pathname: '/',
    query: {},
  },
}

export default connect()(BenchmarSearch)